package com.jiangxfei.mymvp.app.home.module;

import com.jiangxfei.mymvp.app.home.mvp.HomeConstract;
import com.jiangxfei.mymvp.app.home.mvp.HomeModel;
import com.jiangxfei.mymvp.app.home.mvp.HomePresenter;
import com.jiangxfei.mymvp.config.APIService;
import com.jiangxfei.mymvp.di.ActivityScope;

import dagger.Module;
import dagger.Provides;

@Module
public class HomeActivityModule {
    private HomeConstract.LoadAllView loadAllView;

    public HomeActivityModule(HomeConstract.LoadAllView loadAllView) {
        this.loadAllView = loadAllView;
    }

    @ActivityScope
    @Provides
    public HomeConstract.LoadAllView providerLoadAllView() {
        return loadAllView;
    }

    @ActivityScope
    @Provides
    HomeConstract.LoadAllPersenter providerLoadAllPersenter(HomeConstract.LoadAllModel loadAllModel) {
        return new HomePresenter(loadAllModel, loadAllView);
    }

    @ActivityScope
    @Provides
    HomeConstract.LoadAllModel providerLoadAllModel(APIService apiService) {
        return new HomeModel(apiService);
    }
}
